<div class="layui-card">
    <div class="layui-card-body" id="learn-statistics-div">
        <table class="layui-table" id="learn-content" lay-filter="learn-content-filter"></table>
    </div>
</div>

<script>
    layui.use(['laydate','index', 'form', 'table', 'util', 'config', 'admin', 'layer'], function () {
        var table = layui.table;
        var config = layui.config;
        var laydate = layui.laydate;
        var admin = layui.admin;

        // let user = index.getUser();
        // let userid=user.userid;
        let userid = admin.getTempData("learn_userid");
        let sicode = admin.getTempData("learn_sicode");
        // 渲染表格
        table.render({
            elem: '#learn-content',
            url: config.base_server + 'api-study/learnIter/query',
            method: 'POST',
            where: {
                access_token: config.getToken().access_token,
                sicode: sicode,
                userid: userid
            },
            page: false,
            height: 'full-350',
            cols: [[
                {type: 'numbers'},
                {field: 'conten', title: '学习内容'},
                {field: 'statim', title: '内容开始时间',
                    // templet:function (data) {
                    //     if(data.statim==''||data.statim==null){
                    //         return ' <input type="text" class="layui-input-time" style="border: none">'
                    //     }else {
                    //         return data.statim;
                    //     }
                    //
                    // }
                },
                {field: 'endtim',  title: '内容结束时间'},
                {field: 'unders',  title: '理解程度'},
                {field: 'practi',  title: '练习程度'},
            ]],
            // done:function () {
            //     $(".layui-input-time").each(function (i) {
            //         laydate.render({
            //             elem: this,
            //             min: '2020-10-20',
            //             ready:function (time) {
            //                 let date=time.year+"-"+time.month+"-"+time.date;
            //                 console.log(date);
            //                 admin.req('api-study/learnIter/update',JSON.stringify(date),function (res) {
            //
            //                 },"POST")
            //             }
            //         })
            //     })
            // }
        })
    })
</script>